package com.mystyle.le.weekproject.sqlite;

import android.content.Context;
import android.database.DatabaseErrorHandler;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by le on 2016/10/13.
 */
public class MySqlite extends SQLiteOpenHelper {
    private static final String NAME = "MC.db";
    private static final int VERSION =1;

    public MySqlite(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }
    public MySqlite(Context context) {
        super(context, NAME, null, VERSION);
        // TODO Auto-generated constructor stub
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        //创建数据库
        String sql = "create table if not exists data(_id integer primary key autoincrement,name varchar,ranking varchar,state varchar,id1 varchar,icon varchar)";
        db.execSQL(sql);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    }
}
